﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Diagnostics;
using Pats;

namespace DynaCAD
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            CreateTemplate.Click+=new RoutedEventHandler(OpenTemplateCreatorWindow);
            CreateNewPart.Click+=new RoutedEventHandler(OpenNewPartCreatorWindow);
            CreatePart.Click+=new RoutedEventHandler(OpenPartCreatorWindow);
            NewProject.Click+=new RoutedEventHandler(OpenProjectWindow);
        }
        private void OpenProjectWindow(object sender, RoutedEventArgs e)
        { 
            ProjectWindow Window = new ProjectWindow();
            Window.Show();
            Hide();
        }

        private void OpenTemplateCreatorWindow(object sender, RoutedEventArgs e)
        {
            TemplateCreator Window = new TemplateCreator();
            Window.Show();
            Hide();
        }
        private void OpenNewPartCreatorWindow(object sender, RoutedEventArgs e)
        {
            NewPartCreator Window = new NewPartCreator();
            Window.Show();
            Hide();
        }
        private void OpenPartCreatorWindow(object sender, RoutedEventArgs e)
        {
            PartCreator Window = new PartCreator();
            Window.Show();
            Hide();
        }

        private void WindowKeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.F1)
            {
                pvdcd.Project.OpenHelp();
            }
        }
    }
}
